'''
类和对象
'''
class Person:
    def __init__(self,name,age,height):
        self.name = name
        self.age = age
        self.height = height

    def __str__(self):
        return "我的名字叫 %s 今年是 %d 身高1.%d" % (self.name, self.age,self.height)

    def run(self):
        print("我叫%s,今年%d 爱跑步，身高1.%d 跑完去吃东西" % (self.name,self.age,self.height))

    def eat(self):
        print("我叫%s,今年%d 爱跑步，身高1.%d 是吃货，吃完这顿再减肥" % (self.name,self.age,self.height))

xiaoming = Person('小明',18,75)
xiaomei = Person('小美',17,65)

xiaoming.run()
xiaomei.eat()



class Dog:
    def __init__(self,name,color):
        self.name = name
        self.color = color
    def __str__(self):
        return"我叫%s,我的毛是%s的" % (self.name,self.color)
    def shout(self):
        print("我叫%s,我的毛是%s的 陌生人来了汪汪叫" % (self.name,self.color))
    def shake(self):
        print("我叫%s,我的毛是%s的 主人回家了摇尾巴" % (self.name,self.color))
yellow = Dog('大黄','黄颜色')
yellow.shake()
yellow.shout()
